package com.tinyseed.hmxx.common.base;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 版权所有 © Copyright 2019<br>
 *
 * @Description: <br>
 * @CreateDate: Created in 2019/9/2 15:48 <br>
 * @Author: Simon.Yu
 * @Modify:
 */
@Component
public class ErrorCodeManager {

    private static Map codes;

    private static Environment env;

    public static String getMsg(int code) {
        if (env != null) {
            return env.getProperty(code + "");
        } else {
            return null;
        }
    }

    @Autowired
    public void setEnv(Environment env) {
        ErrorCodeManager.env = env;
    }
}
